import { services } from '@/config'

export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuSpan: 6,
  dialogWidth: '80%',
  mockBtn: true,
  column: [
    {
      type: 'input',
      label: '主键',
      prop: 'id',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '唯一编码（用于关联附件）',
      prop: 'unid',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '创建人ID',
      prop: 'createId',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '创建人所属OU的ID',
      prop: 'deptId',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '创建人所属OU的全称',
      prop: 'deptFullname',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '标题',
      prop: 'subject',
      span: 24,
      width: 120,
      search: true,
      maxLength: 64,
      rules: [
        {
          required: true,
          message: '请输入标题',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'input',
      label: '文档类型',
      prop: 'doctype',
      span: 12,
      display: false
    },
    {
      type: 'select',
      label: '所属文档',
      prop: 'sourceid',
      span: 12,
      dicUrl: `${services.adminService}doctype/getAllDocTypeOption`,
      dicMethod: 'get',
      props: { label: 'docName', value: 'id' },
      hide: true,
      rules: [
        {
          required: true,
          message: '请输入所属文档',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'tree',
      label: '所属分类',
      prop: 'ctiId',
      span: 12,
      dicUrl: `${services.adminService}messagecti/tree`,
      dicMethod: 'get',
      props: { label: 'name', value: 'id' },
      hide: true,
      rules: [
        {
          required: true,
          message: '请输入所属分类',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'input',
      label: '分类名称',
      prop: 'ctiName',
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '分类全名称',
      prop: 'ctiFullname',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '分类全编码',
      prop: 'ctiFullcode',
      display: false,
      span: 12,
      hide: true
    },
    {
      type: 'radio',
      label: '状态', // 默认为0{0：启用、1：禁用}
      prop: 'status',
      span: 12,
      display: false,
      value: '0',
      dicData: [
        {
          label: '启用',
          value: 0
        },
        {
          label: '禁用',
          value: 1
        }
      ],
      rules: [
        {
          required: true,
          message: '请选择状态',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'radio',
      label: '完成时限', // 0：长期坚持；1：周期完成。如果是周期完成就必须填写开始结束时间
      prop: 'timelimitType',
      span: 12,
      value: '0',
      dicData: [
        {
          label: '长期坚持',
          value: '0'
        },
        {
          label: '周期完成',
          value: '1'
        }
      ]
    },
    {
      type: 'checkbox',
      label: '提醒方式', // (支持多选格式如0,0,0；代表短信、系统消息、邮件。1代表需要，0代表不需要中)
      prop: 'modes',
      span: 12,
      width: 120,
      multiple: true,
      dicData: [
        {
          label: '短信',
          value: '0'
        },
        {
          label: '系统消息',
          value: '1'
        },
        {
          label: '邮件',
          value: '2'
        }
      ],
      rules: [
        {
          required: true,
          message: '请输入提醒方式',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'date',
      label: '开始时间',
      prop: 'startdate',
      span: 12,
      width: 100,
      valueFormat: 'yyyy-MM-dd',
      format: 'yyyy-MM-dd',
      display: false,
      rules: [
        {
          required: true,
          message: '请输入开始时间',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'date',
      label: '结束时间',
      prop: 'enddate',
      span: 12,
      width: 100,
      display: false,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      rules: [
        {
          required: true,
          message: '请输入结束时间',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'input',
      label: '打开超链接',
      prop: 'openUrl',
      span: 24,
      hide: true
    },
    {
      type: 'radio',
      label: '打开类型',
      prop: 'openType',
      span: 12,
      hide: true,
      value: 'N',
      dicData: [
        {
          label: '内部跳转',
          value: 'N'
        },
        {
          label: '外部跳转',
          value: 'Y'
        }
      ]
    },
    {
      type: 'select',
      label: '定时任务',
      prop: 'jobId',
      span: 12,
      dicUrl: '/job/sys-job/jobAll',
      dicMethod: 'get',
      props: { label: 'jobName', value: 'jobId' },
      width: 110,
      rules: [
        {
          required: true,
          message: '请选择定时任务',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'textarea',
      label: '消息描述',
      prop: 'infor',
      span: 24,
      hide: true
    },
    {
      type: 'textarea',
      label: '备注',
      prop: 'remarks',
      span: 24,
      hide: true
    },
    {
      type: 'input',
      label: '创建人姓名',
      prop: 'createBy',
      span: 12,
      width: 100,
      display: false
    },
    {
      type: 'input',
      label: '创建时间',
      prop: 'createTime',
      span: 12,
      width: 135,
      display: false
    },
    {
      hide: true,
      label: '附件上传',
      prop: 'uploadPage',
      type: 'upload',
      loadText: '附件上传中，请稍等',
      span: 24,
      propsHttp: {
        res: 'data'
      },
      tip: '上传同步至文件服务器',
      action: `${services.adminService}sys-file/upload`,
      limit: 10,
      multiple: true,
      fileSize: 10240000
    }
  ]
}

export const formOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuSpan: 6,
  dialogWidth: '80%',
  menuBtn: false,
  column: [
    {
      type: 'input',
      label: '主键',
      prop: 'id',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '唯一编码（用于关联附件）',
      prop: 'unid',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '创建人ID',
      prop: 'createId',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '创建人所属OU的ID',
      prop: 'deptId',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '创建人所属OU的全称',
      prop: 'deptFullname',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '标题',
      prop: 'subject',
      span: 24,
      width: 120,
      search: true,
      maxLength: 64,
      rules: [
        {
          required: true,
          message: '请输入标题',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'input',
      label: '文档类型',
      prop: 'doctype',
      span: 12,
      display: false
    },
    {
      type: 'select',
      label: '所属文档',
      prop: 'sourceid',
      span: 12,
      dicUrl: `${services.adminService}doctype/getAllDocTypeOption`,
      dicMethod: 'get',
      props: { label: 'docName', value: 'id' },
      hide: true,
      rules: [
        {
          required: true,
          message: '请输入所属文档',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'tree',
      label: '所属分类',
      prop: 'ctiId',
      span: 12,
      dicUrl: `${services.adminService}messagecti/tree`,
      dicMethod: 'get',
      props: { label: 'name', value: 'id' },
      hide: true,
      rules: [
        {
          required: true,
          message: '请输入所属分类',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'input',
      label: '分类名称',
      prop: 'ctiName',
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '分类全名称',
      prop: 'ctiFullname',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '分类全编码',
      prop: 'ctiFullcode',
      display: false,
      span: 12,
      hide: true
    },
    {
      type: 'radio',
      label: '状态', // 默认为0{0：启用、1：禁用}
      prop: 'status',
      span: 12,
      display: false,
      value: '0',
      dicData: [
        {
          label: '启用',
          value: 0
        },
        {
          label: '禁用',
          value: 1
        }
      ],
      rules: [
        {
          required: true,
          message: '请选择状态',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'radio',
      label: '完成时限', // 0：长期坚持；1：周期完成。如果是周期完成就必须填写开始结束时间
      prop: 'timelimitType',
      span: 12,
      value: '0',
      dicData: [
        {
          label: '长期坚持',
          value: '0'
        },
        {
          label: '周期完成',
          value: '1'
        }
      ]
    },
    {
      type: 'checkbox',
      label: '提醒方式', // (支持多选格式如0,0,0；代表短信、系统消息、邮件。1代表需要，0代表不需要中)
      prop: 'modes',
      span: 12,
      width: 120,
      multiple: true,
      dicData: [
        {
          label: '短信',
          value: '0'
        },
        {
          label: '系统消息',
          value: '1'
        },
        {
          label: '邮件',
          value: '2'
        }
      ],
      rules: [
        {
          required: true,
          message: '请输入提醒方式',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'date',
      label: '开始时间',
      prop: 'startdate',
      span: 12,
      width: 100,
      valueFormat: 'yyyy-MM-dd',
      format: 'yyyy-MM-dd',
      display: false,
      rules: [
        {
          required: true,
          message: '请输入开始时间',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'date',
      label: '结束时间',
      prop: 'enddate',
      span: 12,
      width: 100,
      display: false,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      rules: [
        {
          required: true,
          message: '请输入结束时间',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'input',
      label: '打开超链接',
      prop: 'openUrl',
      span: 24,
      hide: true
    },
    {
      type: 'radio',
      label: '打开类型',
      prop: 'openType',
      span: 12,
      hide: true,
      value: 'N',
      dicData: [
        {
          label: '内部跳转',
          value: 'N'
        },
        {
          label: '外部跳转',
          value: 'Y'
        }
      ]
    },
    {
      type: 'select',
      label: '定时任务',
      prop: 'jobId',
      span: 12,
      dicUrl: '/job/sys-job/jobAll',
      dicMethod: 'get',
      props: { label: 'jobName', value: 'jobId' },
      width: 110,
      rules: [
        {
          required: true,
          message: '请选择定时任务',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'textarea',
      label: '消息描述',
      prop: 'infor',
      span: 24,
      hide: true
    },
    {
      type: 'textarea',
      label: '备注',
      prop: 'remarks',
      span: 24,
      hide: true
    },
    {
      type: 'input',
      label: '创建人姓名',
      prop: 'createBy',
      span: 12,
      width: 100,
      display: false
    },
    {
      type: 'input',
      label: '创建时间',
      prop: 'createTime',
      span: 12,
      width: 135,
      display: false
    }
  ]
}
